from greenlet import greenlet
def producer():
    x = ['a','b','c','d','e','f','g','h']
    for i in x:
        computer_gr.switch(i)

def computer(x):
    for i in range(8):
        x = consumer_gr.switch(chr(ord(x) - 32))

def consumer(x):
    for i in range(8):
        print(x)
        x = producer_gr.switch()

producer_gr = greenlet(producer)
computer_gr = greenlet(computer)
consumer_gr = greenlet(consumer)

producer_gr.switch()

